/**
 * Created by Administrator on 2018-04-23.
 */
var url=window.location.search;
if(url!=null&&url!="") {
    url = url.substr(1, url.length);
}
function parseJson(param)
{
    var obj={};
    var keyvalue=[];
    var key="",value="";
    var paraString = param.split("&");
    for(var i in paraString)
    {
        keyvalue=paraString[i].split("=");
        key=keyvalue[0];
        value=keyvalue[1];
        obj[key]=value;
    }
    return obj;
}
var cols;
var QueryParam= new Object();
QueryParam.term={resource_id:parseJson(url).id};
$.ajax({
    url:"/layui/table/list",
    type:"POST",
    data:{resource_name:"redis_list_structure",querydata:JSON.stringify(QueryParam)},
    async:false,
    success:function (e) {
        console.log("表结构",e)
        cols=e.data[0].resource_detail;
        cols = JSON.parse(cols)
        console.log("对象",cols)
    }
})
 var list_inner= [];
 var list_out= [];
for (var i=0; i<cols.length; i++)
{
    var column=new Object();
    console.log(cols[i]);
    column.field=cols[i].rd_name.valueOf();
    column.title=cols[i].rd_cn_name.valueOf();
    //column.width=100/cols.length+'%';
    column.width=120;
    column.is_system=cols[i].is_system.valueOf();
    //cols[i]["width"]=200;
    //console.log(100/cols.length);
    list_inner.push(column)

}
console.log("list_inner",list_inner)
list_out[0]=list_inner;
cols=list_out;
console.log("最终出去的结果",cols)